import request from '@/utils/request'

export const getList = (params: any,page: number, limit: number) =>
  request({
    url: `/api/source/list?page=${page}&limit=${limit}`,
    method: 'get',
    params
  })
export const createSource = (data: any) =>
  request({
    url: '/api/source/create',
    method: 'post',
    data
  })

export const updateSource = (id: number, data: any) =>
  request({
    url: `/api/source/${id}`,
    method: 'put',
    data
  })

export const getSource = (id: number) =>
  request({
    url: `/api/source/${id}`,
    method: 'get',
  })

export const deleteSource = (id: number) =>
  request({
    url: `/api/source/${id}`,
    method: 'delete'
  })

export const deleteCollectSource = (data: any) =>
  request({
    url: `/api/source/deleteCollect`,
    method: 'delete',
    data
  })
export const getSourceCollect = () =>
  request({
    url: '/api/source/collect',
    method: 'get',
  })

